package sga.gui.base;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import java.awt.Scrollbar;
import java.awt.Window.Type;
import java.awt.Font;

public class TelaClassificacaoJogadores extends JFrame {
	public TelaClassificacaoJogadores() {
		setTitle("Tela de Classifica\u00E7\u00E3o");
		setBounds(100, 100, 400,350);
		
		JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.NORTH);
		
		JLabel lblClassificao = new JLabel("Classifica\u00E7\u00E3o");
		lblClassificao.setFont(new Font("Times New Roman", Font.PLAIN, 20));
		lblClassificao.setLabelFor(panel);
		panel.add(lblClassificao);
		
		JTextArea textArea = new JTextArea();
		getContentPane().add(textArea, BorderLayout.CENTER);
		
		Scrollbar scrollbar = new Scrollbar();
		getContentPane().add(scrollbar, BorderLayout.WEST);
		
		for (int i = 0; i < TelaInicial.grupo.getClassificacao().size(); i++) {
			textArea.insert("Apostador: "+TelaInicial.grupo.getClassificacao().get(i).getNome()+
					" Pontos: "+TelaInicial.grupo.getClassificacao().get(i).getPontos()+"\n",textArea.getCaretPosition());
			
			System.out.println(TelaInicial.grupo.getClassificacao().get(i).getNome());
		}
	}

}
